extends NodeState

@export var enemy: BasicEnemy


const DURATION := 0.2

var time := 0.0

func _on_process(delta : float) -> void:
	time += delta


func _on_next_transitions() -> void:
	if time > DURATION:
		transition_state(BasicEnemy.STATE_IDLE)


func _on_enter() -> void:
	enemy.collisionShape.set_deferred("disabled", true)

	time = 0.0
	enemy.animationPlayer.play(BasicEnemy.ANIMATION_LAND)


func _on_exit() -> void:
	enemy.collisionShape.set_deferred("disabled", false)
